home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
L' Effet Pommier 3
/
L'Effet Pommier - Volume 03.iso
/
Programmation
/
Alpha ƒ
/
Tcl
/
SystemCode
/
latexMenu.tcl
< prev
next >
Wrap
Text File
|
1996-01-20
|
15KB
|
821 lines
#############################################################################
#############################################################################
#
# latexMenu.tcl (called from latex.tcl)
#
# LaTeX menu definition and key bindings
#
#############################################################################
#
# Author: Tom Scavo <trscavo@syr.edu>
#
#############################################################################
#############################################################################
proc getLaTeXCommands {} {
set latexCommands {
{<S/TTypeset}
{<S<I<O/TTypeset Selection}
{menu -M TeX -n Goto -m -p LaTeXMenuItem {
"<U/SLaTeX"
"BibTeX"
"MakeIndex"
"(-"
{/cNext Tab Stop}
{<U/cPrev Tab Stop}
{<B/cnth Tab Stop╔}
"(-"
{Next Command}
{Prev Command}
{Next Command Select}
{Prev Command Select}
{Next Command Select With Args}
{Prev Command Select With Args}
"(-"
{Next Environment}
{Prev Environment}
{Next Environment Select}
{Prev Environment Select}
"(-"
{Next Section}
{Prev Section}
{Next Section Select}
{Prev Section Select}
{Next Subsection}
{Prev Subsection}
{Next Subsection Select}
{Prev Subsection Select}
}
}
{menu -M TeX -n {LaTeX Utilities} -m -p LaTeXMenuItem {
{<U<O/TChoose Command╔}
"(-"
{<I/cInsert Literal Tab}
{Insert Tab Stop}
"(-"
{<O/cDelete Tab Stops}
{Delete Comments}
"(-"
{Convert Quotes}
{Convert Dollar Signs}
"(-"
{Remove Auxiliary Files}
"(-"
{Short LaTeX Menu}
}
}
{(-}
{menu -M TeX -n Documents -m -p LaTeXMenuItem {
"letter"
"article"
"report"
"book"
"slides"
"<B<I/Dgeneric╔"
"(-"
"options╔"
"packages╔"
"<B<I/Uusepackage"
"(-"
"filecontents╔"
}
}
{menu -M TeX -n {Page Layout} -m -p LaTeXMenuItem {
"maketitle"
"(-"
"abstract"
"titlepage"
"(-"
"pagestyle╔"
"thispagestyle╔"
"pagenumbering╔"
"(-"
"twocolumn"
"onecolumn"
}
}
{menu -M TeX -n Sectioning -m -p LaTeXMenuItem {
"part"
"chapter"
"section"
"subsection"
"subsubsection"
"paragraph"
"subparagraph"
"(-"
"appendix"
}
}
{(-}
}
return $latexCommands
}
proc getTextSubmenus {} {
return {
{menu -M TeX -n {Text Style} -m -p LaTeXMenuItem {
"<S<B<I/Eemph"
"<S<U<B<I/Eem"
"<B<O/Uunderline"
"(-"
"<Supshape"
"<Stextup"
"<E<S<B<I/Itextit"
"<S<U<B<I/Iitshape"
"<E<S<B<I/Stextsl"
"<S<U<B<I/Sslshape"
"<E<S<B<I/Htextsc"
"<S<U<B<I/Hscshape"
"(-"
"<Smdseries"
"<Stextmd"
"<E<S<B<I/Btextbf"
"<S<U<B<I/Bbfseries"
"(-"
"<S<B<I/Rtextrm"
"<S<U<B<I/Rrmfamily"
"<E<S<B<I/Wtextsf"
"<S<U<B<I/Wsffamily"
"<E<S<B<I/Ytexttt"
"<S<U<B<I/Yttfamily"
"(-"
"<Snormalfont"
"<Stextnormal"
}
}
{menu -M TeX -n {Text Size} -m -p LaTeXMenuItem {
"<B<I/1tiny"
"<B<I/2scriptsize"
"<B<I/3footnotesize"
"<B<I/4small"
"<B<I/5normalsize"
"<B<I/6large"
"<B<I/7Large"
"<B<I/8LARGE"
"<B<I/9huge"
"<B<I/0Huge"
}
}
{menu -M TeX -n International -m -p LaTeXMenuItem {
{ÿ}
{ù}
{Ö}
{Ü}
{¢}
"(-"
{ì}
{╧}
{╛}
{î}
{┐}
"(-"
{é}
{╬}
{«}
{ü}
{»}
"(-"
{º}
{┴}
{└}
}
}
{menu -M TeX -n Environments -m -p LaTeXMenuItem {
"<I/kitemize╔"
"<U<I/kenumerate╔"
"<B<I/kdescription╔"
"thebibliography╔"
"(-"
"<I/lslide"
"<U<I/loverlay"
"<B<I/lnote"
"(-"
"<I/mfigure"
"<U<I/mtable"
"<B<I/mtabular╔"
"(-"
"<I/nverbatim"
"<U<I/nquote"
"<B<I/nquotation"
"verse"
"(-"
"<I/ocenter"
"<U<I/oflushleft"
"<B<I/oflushright"
"(-"
"<I/pgeneral╔"
}
}
{menu -M TeX -n Boxes -m -p LaTeXMenuItem {
"<B<I/Mmbox"
"makebox"
"fbox"
"framebox"
"(-"
"newsavebox"
"sbox"
"savebox"
"usebox"
"(-"
"raisebox"
"(-"
"parbox"
"minipage"
"(-"
"rule"
}
}
{menu -M TeX -n Miscellaneous -m -p LaTeXMenuItem {
"<B<I/Vverb"
"<B<I/Ffootnote"
{<B<I/Nmarginal note}
"(-"
"<B<I/Llabel"
"<B<I/Xref"
"<B<I/Ppageref"
"<B<I/Ccite"
"<U<B<I/Cnocite"
"(-"
"<B<I/Jitem"
"(-"
"<B<I/'quotes"
{<U<B<I/'double quotes}
"(-"
"!╔ellipsis"
"!╨en-dash"
"!╤em-dash"
{TeX logo}
{LaTeX logo}
{LaTeX2e logo}
"date"
"(-"
"!ádag"
"ddag"
{!ñsection mark}
{!ªparagraph mark}
"!⌐copyright"
"!úpounds"
}
}
}
}
proc mathModeSubmenu {} {
global TeXmodeVars
if {$TeXmodeVars(useDollarSigns)} then {
bind '4' <zc> texMath "TeX"
bind '4' <zoc> texDisplaymath "TeX"
return {menu -M TeX -n {Math Modes} -m -p LaTeXMenuItem {
{<B<O/MTeX math}
{<B<I<O/MTeX displaymath}
"(-"
{LaTeX math}
{LaTeX displaymath}
}
}
} else {
bind '4' <zc> latexMath "TeX"
bind '4' <zoc> latexDisplaymath "TeX"
return {menu -M TeX -n {Math Modes} -m -p LaTeXMenuItem {
{TeX math}
{TeX displaymath}
"(-"
{<B<O/MLaTeX math}
{<B<I<O/MLaTeX displaymath}
}
}
}
}
proc getMathModeSubmenu {} {
return [list [mathModeSubmenu]]
}
proc getMathSubmenus {} {
set mathSubmenus {
{menu -M TeX -n {Math Style} -m -p LaTeXMenuItem {
"<B<I<O/Imathit"
"<B<I<O/Rmathrm"
"<B<I<O/Bmathbf"
"<B<I<O/Wmathsf"
"<B<I<O/Ymathtt"
"<B<I<O/Cmathcal"
"(-"
"<B<I<O/Ddisplaystyle"
"<B<I<O/Ttextstyle"
"<B<I<O/Sscriptstyle"
"scriptscriptstyle"
}
}
{menu -M TeX -n {Math Environments} -m -p LaTeXMenuItem {
"<I/imath"
"(-"
"<U<I/idisplaymath"
"<B<I/iequation"
"(-"
"<U<I/jeqnarray*╔"
"<B<I/jeqnarray╔"
"(-"
"<I/jarray╔"
"(-"
"<I/pgeneral╔"
}
}
{menu -M TeX -n Formulas -m -p LaTeXMenuItem {
"subscript"
"superscript"
"(-"
"<B<O/Ffrac"
{<B<O/Rsqrt}
{nth root}
"(-"
{<B<O/1one parameter╔}
{<B<O/2two parameters╔}
}
}
{menu -M TeX -n Greek -m -p LaTeXMenuItem {
"alpha"
"beta"
"<SGamma"
"<Sgamma"
"<E<SDelta"
"<Sdelta"
"epsilon"
"zeta"
"eta"
"<STheta"
"<Stheta"
"iota"
"kappa"
"<SLambda"
"<Slambda"
"mu"
"nu"
"<SXi"
"<Sxi"
"omicron"
"<SPi"
"<Spi"
"rho"
"<SSigma"
"<Ssigma"
"tau"
"<SUpsilon"
"<Supsilon"
"<E<SPhi"
"<Sphi"
"chi"
"<SPsi"
"<Spsi"
"<E<SOmega"
"<Somega"
"(-"
"varepsilon"
"vartheta"
"varpi"
"varrho"
"varsigma"
"varphi"
}
}
{menu -M TeX -n {Binary Operators} -m -p LaTeXMenuItem {
"!▒pm"
"mp"
"times"
"!╓div"
"ast"
"star"
"circ"
"bullet"
"cdot"
"cap"
"cup"
"uplus"
"sqcap"
"sqcup"
"vee"
"wedge"
"setminus"
"(-"
"diamond"
"bigtriangleup"
"bigtriangledown"
"triangleleft"
"triangleright"
"lhd"
"rhd"
"unlhd"
"unrhd"
"(-"
"oplus"
"ominus"
"otimes"
"oslash"
"odot"
"(-"
"bigcirc"
"dagger"
"ddagger"
"amalg"
"wr"
}
}
{menu -M TeX -n Relations -m -p LaTeXMenuItem {
"<S!│geq"
"<S!▓leq"
"<E<Ssucc"
"<Sprec"
"<E<Ssucceq"
"<Spreceq"
"<E<S!╚gg"
"<S!╟ll"
"<E<Ssupset"
"<Ssubset"
"<E<Ssupseteq"
"<Ssubseteq"
"<E<Ssqsupset"
"<Ssqsubset"
"<E<Ssqsupseteq"
"<Ssqsubseteq"
"<E<Sni"
"<Sin"
"<E<Sdashv"
"<Svdash"
"(-"
"equiv"
"sim"
"simeq"
"asymp"
"!┼approx"
"cong"
"!¡neq"
"doteq"
"propto"
"(-"
"models"
"perp"
"mid"
"parallel"
"bowtie"
"join"
"smile"
"frown"
}
}
{menu -M TeX -n Arrows -m -p LaTeXMenuItem {
"<SLeftarrow"
"<Sleftarrow"
"<E<SRightarrow"
"<Srightarrow"
"<E<SLeftrightarrow"
"<Sleftrightarrow"
"<E<SLongleftarrow"
"<Slongleftarrow"
"<E<SLongrightarrow"
"<Slongrightarrow"
"<E<SLongleftrightarrow"
"<Slongleftrightarrow"
"(-"
"<SUparrow"
"<Suparrow"
"<E<SDownarrow"
"<Sdownarrow"
"<E<SUpdownarrow"
"<Supdownarrow"
"(-"
"mapsto"
"longmapsto"
"leadsto"
"(-"
"leftharpoonup"
"rightharpoonup"
"leftharpoondown"
"rightharpoondown"
"rightleftharpoons"
"hookleftarrow"
"hookrightarrow"
"nearrow"
"searrow"
"swarrow"
"nwarrow"
}
}
{menu -M TeX -n Dots -m -p LaTeXMenuItem {
"bullet"
"cdot"
"(-"
"ldots"
"cdots"
"vdots"
"ddots"
}
}
{menu -M TeX -n Symbols -m -p LaTeXMenuItem {
"aleph"
"hbar"
"imath"
"jmath"
"ell"
"wp"
"Re"
"Im"
"mho"
"(-"
"angle"
"backslash"
"bot"
"emptyset"
"exists"
"forall"
"!░infty"
"nabla"
"!┬neg"
"!╢partial"
"prime"
"!├surd"
"top"
"(-"
"Box"
"Diamond"
"triangle"
"clubsuit"
"diamondsuit"
"heartsuit"
"spadesuit"
"(-"
"flat"
"natural"
"sharp"
}
}
{menu -M TeX -n Functions -m -p LaTeXMenuItem {
"arccos"
"arcsin"
"arctan"
"arg"
"cos"
"cosh"
"cot"
"coth"
"csc"
"deg"
"det"
"dim"
"exp"
"gcd"
"hom"
"inf"
"ker"
"lg"
"<B<O/Llim"
"liminf"
"limsup"
"ln"
"log"
"max"
"min"
"Pr"
"sec"
"sin"
"sinh"
"sup"
"tan"
"tanh"
"(-"
"bmod"
"pmod"
}
}
{menu -M TeX -n {Large Operators} -m -p LaTeXMenuItem {
"<B<O/Ssum"
"<B<O/Pprod"
"coprod"
"<B<O/Iint"
"oint"
"(-"
"bigcup"
"bigcap"
"bigsqcup"
"bigvee"
"bigwedge"
"bigodot"
"bigotimes"
"bigoplus"
"biguplus"
}
}
{menu -M TeX -n Delimiters -m -p LaTeXMenuItem {
"parentheses"
"brackets"
"braces"
{vertical bars}
{other delims╔}
"(-"
{half-open interval}
{half-closed interval}
"(-"
{big parentheses}
{big brackets}
{big braces}
{big vertical bars}
{other big delims╔}
"(-"
{big left brace}
{other mixed big delims╔}
}
}
{menu -M TeX -n {Math Accents} -m -p LaTeXMenuItem {
"<B<O/Aacute"
"<B<O/Bbar"
"breve"
"<B<O/Ccheck"
"<B<O/Ddot"
"ddot"
"<B<O/Ggrave"
"<B<O/Hhat"
"<B<O/Ttilde"
"<B<O/Vvec"
"(-"
"widehat"
"widetilde"
"(-"
"imath"
"jmath"
}
}
{menu -M TeX -n Grouping -m -p LaTeXMenuItem {
"<B<O/Uunderline"
"<B<O/Ooverline"
"<B<I<O/Uunderbrace"
"<B<I<O/Ooverbrace"
"(-"
"stackrel"
}
}
{menu -M TeX -n Spacing -m -p LaTeXMenuItem {
{neg thin}
"thin"
"medium"
"thick"
"(-"
"quad"
"qquad"
"(-"
"hspace"
"vspace"
"(-"
"hfill"
"vfill"
"(-"
"smallskip"
"medskip"
"bigskip"
}
}
}
return [concat [getMathModeSubmenu] $mathSubmenus]
}
proc getTextSubsubmenus {} {
set m [getTextSubmenus]
set mm [list menu -M TeX -n {Text Submenus} -m -p LaTeXMenuItem $m]
return [list $mm]
}
proc getMathSubsubmenus {} {
set m [getMathSubmenus]
set mm [list menu -M TeX -n {Math Submenus} -m -p LaTeXMenuItem $m]
return [list $mm]
}
proc getLaTeXMenu {} {
global useShortLaTeXMenu
set latexCommands [getLaTeXCommands]
if {$useShortLaTeXMenu} {
return [concat $latexCommands [getTextSubsubmenus] {{(-}} [getMathSubsubmenus]]
} else {
return [concat $latexCommands [getTextSubmenus] {{(-}} [getMathSubmenus]]
}
}
proc buildLaTeXMenu {} {
global latexMenu useShortLaTeXMenu
menu -M TeX -n $latexMenu -m -p LaTeXMenuItem [getLaTeXMenu]
markMenuItem {LaTeX Utilities} {Short LaTeX Menu} $useShortLaTeXMenu
}
proc toggleLaTeXMenus {} {
global latexMenu useShortLaTeXMenu modifiedVars
watchCursor
set useShortLaTeXMenu [expr 1 - $useShortLaTeXMenu]
lappend modifiedVars useShortLaTeXMenu
buildLaTeXMenu
markMenuItem {LaTeX Utilities} {Short LaTeX Menu} $useShortLaTeXMenu
}
proc LaTeXMenuItem {menu item} {
switch $item {
{Typeset} {set func "typeset"}
{Typeset Selection} {set func "typesetSelection"}
"LaTeX" {set func "latex"}
"BibTeX" {set func "bibtex"}
"MakeIndex" {set func "makeindex"}
{Next Tab Stop} {set func "nextTabStop"}
{Prev Tab Stop} {set func "prevTabStop"}
{nth Tab Stop} {set func "nthTabStop"}
{Next Command} {set func "nextCommand"}
{Prev Command} {set func "prevCommand"}
{Next Command Select} {set func "nextCommandSelect"}
{Prev Command Select} {set func "prevCommandSelect"}
{Next Command Select With Args} {set func "nextCommandSelectWithArgs"}
{Prev Command Select With Args} {set func "prevCommandSelectWithArgs"}
{Next Environment} {set func "nextEnvironment"}
{Prev Environment} {set func "prevEnvironment"}
{Next Environment Select} {set func "nextEnvironmentSelect"}
{Prev Environment Select} {set func "prevEnvironmentSelect"}
{Next Section} {set func "nextSection"}
{Prev Section} {set func "prevSection"}
{Next Section Select} {set func "nextSectionSelect"}
{Prev Section Select} {set func "prevSectionSelect"}
{Next Subsection} {set func "nextSubsection"}
{Prev Subsection} {set func "prevSubsection"}
{Next Subsection Select} {set func "nextSubsectionSelect"}
{Prev Subsection Select} {set func "prevSubsectionSelect"}
{Choose Command} {set func "chooseCommand LaTeX"}
{Insert Literal Tab} {set func "insertLiteralTab"}
{Insert Tab Stop} {set func "insertTabStop"}
{Insert Reference} {set func "insertReference"}
{Delete Tab Stops} {set func "deleteTabStops"}
{Delete Comments} {set func "deleteComments"}
{Convert Quotes} {set func "convertQuotes"}
{Convert Dollar Signs} {set func "convertDollarSigns"}
{Remove Auxiliary Files} {set func "removeAuxiliaryFiles"}
{Short LaTeX Menu} {set func "toggleLaTeXMenus"}
"array" {set func "myArray"}
"eqnarray\*" {set func "eqnarrayStar"}
"ellipsis" {set func "ldots"}
{TeX logo} {set func "texLogo"}
{LaTeX logo} {set func "latexLogo"}
{LaTeX2e logo} {set func "latex2eLogo"}
"date" {set func "today"}
{section mark} {set func "sectionMark"}
{paragraph mark} {set func "paragraphMark"}
{double quotes} {set func "dblQuotes"}
{marginal note} {set func "marginalNote"}
"item" {set func "insertItem"}
{TeX math} {set func "texMath"}
{TeX displaymath} {set func "texDisplaymath"}
{LaTeX math} {set func "latexMath"}
{LaTeX displaymath} {set func "latexDisplaymath"}
{blackboard bold} {set func "blackboardBold"}
{frac} {set func "fraction"}
{sqrt} {set func "squareRoot"}
{nth root} {set func "nthRoot"}
{one parameter} {set func "oneParameter"}
{two parameters} {set func "twoParameters"}
{join} {set func "myJoin"}
{vertical bars} {set func "absoluteValue"}
{other delims} {set func "otherDelims"}
{half-open interval} {set func "half-openInterval"}
{half-closed interval} {set func "half-closedInterval"}
{big parentheses} {set func "bigParentheses"}
{big brackets} {set func "bigBrackets"}
{big braces} {set func "bigBraces"}
{big vertical bars} {set func "bigAbsoluteValue"}
{other big delims} {set func "otherBigDelims"}
{big left brace} {set func "bigLeftBrace"}
{other mixed big delims} {set func "otherMixedBigDelims"}
{neg thin} {set func "negThin"}
default {set func $item}
}
eval $func
}